<template>
	<view class="Page">
		<view class="img">
			<van-image :src="news.data.img_src" width="750rpx" height="250rpx" fit="cover" />
		</view>
		<view class="content">
			<view class="titleInfo">
				<view class="title">
					{{news.data.title}}
				</view>
				<view class="time">
					{{news.time}}
				</view>
			</view>
			<view class="text">
				{{news.data.content}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				news: null
			}
		},
		onLoad() {
			wx.showLoading({
				title:"加载中"
			})
			let self = this
			uni.$on("news", (res) => {
				console.log(res)
				self.news = res
				wx.hideLoading()
			})
			uni.$emit('sendNews')
		},
		onUnload() {
			uni.$off('news')
			uni.$off('sendNews')
		},
		methods: {

		}
	}
</script>

<style scoped>
	.Page {
		display: -webkit-box;
		flex-direction: column;
		display: flex;
		
	}

	.Page .content {
		display: -webkit-box;
		flex-direction: column;
		display: flex;
		padding: 30rpx;
	
	}

	.Page .content .titleInfo {
		display: -webkit-box;
		flex-direction: column;
		display: flex;
	}
	.Page .content .titleInfo .title{
		font-size: 35rpx;
		line-height: 50rpx;
		font-weight: bold;
		margin-bottom: 10rpx;
	}
	
	.Page .content .titleInfo .time{
		color: #E6E6E6;
		font-size: 25rpx;
		margin-bottom: 10rpx;
		
	}
	.Page .content .text{
		font-size: 28rpx;
		line-height: 45rpx;
		font-weight: 10rpx;
		margin-left: 28rpx;
		margin-right: 28rpx;
	}
</style>
